// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-10-7

#ifndef __TRAYICON_H_COMMON_UI__
#define __TRAYICON_H_COMMON_UI__

#pragma once

//##ModelId=44C4B6020203
class CJoyTrayIcon :
    public CCmdTarget
{
    DECLARE_DYNAMIC(CJoyTrayIcon) 

protected:

	//##ModelId=44C4B6020206
    NOTIFYICONDATA m_nid; // struct for Shell_NotifyIcon args 

   
public:


	//##ModelId=44C4B6020213
    CJoyTrayIcon(UINT uID);
	//##ModelId=44C4B6020215
    virtual ~CJoyTrayIcon(void);

	//##ModelId=44C4B6020218
	virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent); 
	//##ModelId=44C4B6020222
    void SetNotificationWnd(CWnd* pNotifyWnd, UINT uCbMsg); 

	//##ModelId=44C4B6020225
    BOOL SetIcon(UINT uID); // main variant you want to use 
	//##ModelId=44C4B6020227
    BOOL SetIcon(HICON hicon, LPCSTR lpTip); 
	//##ModelId=44C4B6020234
    BOOL SetIcon(LPCTSTR lpResName, LPCSTR lpTip) 

    {
        return SetIcon(lpResName ? 
            AfxGetApp()->LoadIcon(lpResName) : NULL, lpTip);
    } 

	//##ModelId=44C4B6020237
    BOOL SetStandardIcon(LPCTSTR lpszIconName, LPCSTR lpTip)
    {
        return SetIcon(::LoadIcon(NULL, lpszIconName), lpTip);
    }
};

#endif  // __TRAYICON_H_COMMON_UI__
